home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Think Class Libraries / Expander / Expander Classes / CExpanderLabelEnv.cp < prev    next >
Encoding:
Text File  |  1994-11-30  |  1.6 KB  |  74 lines  |  [TEXT/KAHL]

  1. /***********************************************************************************
  2.     CExpanderLabelEnv.h
  3.  
  4.     Copyright © 1994 B-Ray Software. All rights reserved.
  5.     Developed using Symantec C++ 7.0.2 and Symantec's TCL library.
  6.     Portions of this code courtesy Symantec, Inc.
  7.  
  8.     This code may be freely distributed as long as this notice remains. This code
  9.     may not be used in any commercial software without the consent of B-Ray Software.
  10.  
  11.     ---
  12.  
  13.     CExpanderLabelEnv provides a drawing environment for the CExpanderLabel class.
  14.     All we do here is set the TextFace to bold.
  15.  
  16. ***********************************************************************************/
  17. #include "CExpanderLabelEnv.h"
  18.  
  19.  
  20. TCL_DEFINE_CLASS_D1( CExpanderLabelEnv, CEnvironment );
  21.  
  22. /*
  23.  * CExpanderLabelEnv constructor
  24.  *
  25.  * Default constructor
  26.  */
  27.  
  28. CExpanderLabelEnv :: CExpanderLabelEnv()
  29. {
  30.     TCL_END_CONSTRUCTOR
  31. }
  32.  
  33.  
  34. /*
  35.  * CExpanderLabel destructor
  36.  *
  37.  * Just a place-holder for Inspector
  38.  */
  39.  
  40. CExpanderLabelEnv :: ~CExpanderLabelEnv()
  41. {
  42.     TCL_START_DESTRUCTOR
  43. }
  44.  
  45.  
  46. /*
  47.  * Restore method - OVERRIDE
  48.  *
  49.  * Sets up the drawing environment for the label. We save the current
  50.  * setting of the port's text face, and set it bold.
  51.  */
  52.  
  53. void CExpanderLabelEnv :: Restore( void )
  54. {
  55.     GrafPtr    curPort;
  56.  
  57.     GetPort( &curPort );            // get drawing world
  58.     savedFace = curPort->txFace;    // remember current value of text face
  59.     TextFace( bold );                // set text face to bold
  60. }
  61.  
  62.  
  63. /*
  64.  * PutBack method - OVERRIDE
  65.  *
  66.  * Restores the drawing environment to how it was before our Restore()
  67.  * method was called. Naming of these methods can be a bit confusing...
  68.  */
  69.  
  70. void CExpanderLabelEnv :: PutBack( void )
  71. {
  72.     TextFace( savedFace );
  73. }
  74.